package org.duiduo.api.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.duiduo.api.valid.ValidationGroups;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单 VO
 *
 * @author liangze
 * @date 2021/9/22 15:15
 */
@Getter
@Setter
public class OrderVO extends BaseBeanVO {

    @NotNull(groups = {ValidationGroups.Update.class}, message = "订单ID不存在")
    private Integer id;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "书名不存在")
    private String name;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "总价(￥)不存在")
    private BigDecimal totalPrice;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "实付款(￥)不存在")
    private BigDecimal payPrice;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "优惠金额(￥)不存在")
    private BigDecimal discount;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "请输入购买数量")
    private Integer count;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "运费(￥)不存在")
    private BigDecimal transportPrice;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "订单编号不存在")
    private String orderNo;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "购买用户不存在")
    private Integer userId;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "书籍ID不存在")
    private Integer bookId;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "用户名不存在")
    private String username;

    @NotNull(groups = {ValidationGroups.Update.class}, message = "创建时间不存在")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
